home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_12
/
1012016b
< prev
next >
Wrap
Text File
|
1992-10-04
|
360b
|
15 lines
/* strpbrk function */
#include <string.h>
char *(strpbrk)(const char *s1, const char *s2)
{ /* find index of first s1[i] that matches any s2[] */
const char *sc1, *sc2;
for (sc1 = s1; *sc1 != '\0'; ++sc1)
for (sc2 = s2; *sc2 != '\0'; ++sc2)
if (*sc1 == *sc2)
return ((char *)sc1);
return (NULL); /* terminating nulls match */
}